import javax.swing.*; 
import java.awt.*;
class MiListCellRenderer extends DefaultListCellRenderer {

	protected DefaultListCellRenderer defaultRenderer = new DefaultListCellRenderer();
	ImageIcon iconoHombre; ImageIcon iconoMujer;
	
	public MiListCellRenderer () {
		iconoHombre = new ImageIcon(MiListCellRenderer.class.getResource("Imagenes/hombre.png")); 
		iconoMujer = new ImageIcon(MiListCellRenderer.class.getResource("Imagenes/mujer.png")); 
		
	}
	public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean hasFocus){
		JLabel renderer = (JLabel) defaultRenderer.getListCellRendererComponent(list, value, index, isSelected,hasFocus);
	
		if (list.getModel().getElementAt(index)) { 
			renderer.setIcon(iconoHombre);
		} else
			if (list.getModel().getElementAt(index))
				renderer.setIcon(iconoMujer); 
			 
	return renderer;
}
}